package java_thinking.unit_11._11_8;

import java_thinking.net.mindview.util.Stack;

/**
 * @Description :
 * @author: cww
 * @DateTime: 2019-03-17 21:28
 */

public class E15 {
    public static Stack<Character> stack = new Stack<Character>();
    private static void evaluate(String expr){
        char data[] = expr.toCharArray();
        for (int i =0;i<expr.length();i++){
            switch (data[i++]){
                case '+': stack.push(data[i]);
                break;
                case '-':
                    System.out.println(stack.pop());
                break;
                default:break;
            }
        }
    }

    public static void main(String[] args) {
        evaluate("+U+n+c---+e+r+t---+a-+i-+n+t+y---+ -+r+u--+l+e+s---");
    }
}
